/*
** xutils.c for xutils in /home/deubel_j//colle
** 
** Made by james deubelbeiss
** Login   <deubel_j@epitech.net>
** 
** Started on  Mon Apr 18 20:26:09 2011 james deubelbeiss
** Last update Mon Apr 18 20:26:32 2011 james deubelbeiss
*/

#include	<stdlib.h>
#include	<unistd.h>

void	*xmalloc(int size)
{
  void	*ptr;

  ptr = NULL;
  if (size)
    if (!(ptr = malloc(size)))
      {
	write(2, "Can't perform malloc\n", 21);
	exit(0);
      }
  return (ptr);
}

void	xfree(void *ptr)
{
  if (ptr == NULL)
    {
      write(2, "bad free.\n", 16);
      exit(0);
    }
  free(ptr);
  ptr = NULL;
}
